<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>个人信息修改</title>
<script type="text/javascript" src="${pageContext.request.contextPath }/scripts/jquery-1.7.2.js"></script>
<script  src="bootstrap/js/jquery-3.2.0.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>

<script type="text/javascript">
$(function(){
	$(":input[name='userName']").change(function(){
		var val = $(this).val();			
		val = $.trim(val);
		$("#message").html("");
		//JS中使用EL表达式只需要添加 单引号或者双引号即可
		var proName = '${session.user.userName}';
		if(val != "" && val != proName){
			var url = "um-checkName";
			var args = {"checkUserName":val,"time": new Date()};
			$.post(url,args,function(data){
				  $("#message").html(data); 
			});
		}
	});		
});


</script>

</head>
<body>
	<%@include file = "../navigationBar.jsp" %> 
	<form action="um-selfMsgModifCommit" method="post">
		<table width="440px">
			<tr>
				<td width="30%">Id：</td>
				<td><input type="text" name="userId" value='<s:property value="#session.user.userId"/>'readonly="readonly" /></td>
			</tr>
			<tr>
				<td width="30%">姓名：</td>
				<td><input type="text" name="userName" value='<s:property value="#session.user.userName"/>' /><strong id="message"></strong></td>
			</tr>
			<tr>
				<td width="30%">密码：</td>
				<td><input type="password" name="userPassword" value='<s:property value="#session.user.userPassword"/>' /></td>
			</tr>
			<tr>
				<td width="30%">电话：</td>
				<td><input type="text" name="phone" value='<s:property value="#session.user.phone"/>' /></td>
			</tr>
			<tr>
				<td width="30%">邮箱：</td>
				<td><input type="text" name="email" value='<s:property value="#session.user.email"/>' /></td>
			</tr>
			<tr>
				<td width="30%">真实姓名：</td>
				<td><input type="text" name="realName" value='<s:property value="#session.user.realName"/>' /></td>
			</tr>
			<tr>
				<td width="30%">身份证：</td>
				<td><input type="text" name="idCard" value='<s:property value="#session.user.idCard"/>' /></td>
			</tr>
			<tr>
				<td width="30%">联系地址：</td>
				<td><input type="text" name="address" value='<s:property value="#session.user.address"/>' /></td>
			</tr>
			<tr>
    			<td colspan="2" align="center"><input class="button" type="submit" value="修改"></td>
  			</tr>
		</table>
	</form>


</body>
</html>